<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->


<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<!DOCTYPE html
  PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="zh-cn" xml:lang="zh-cn">
<head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
   
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="DC.Type" content="topic">
<meta name="DC.Title" content="创建SFTP用户">
<meta name="product" content="">
<meta name="DC.Relation" scheme="URI" content="zh-cn_topic_0000001965939061.html">
<meta name="prodname" content="">
<meta name="version" content="">
<meta name="brand" content="30-OceanProtect 备份一体机 1.5.0-1.6.0 帮助中心">
<meta name="DC.Publisher" content="20240320">
<meta name="DC.Format" content="XHTML">
<meta name="DC.Identifier" content="ZH-CN_TOPIC_0000001966059265">
<meta name="DC.Language" content="zh-cn">
<link rel="stylesheet" type="text/css" href="public_sys-resources/commonltr.css">
<title>创建SFTP用户</title>
</head>
<body style="clear:both; padding-left:10px; padding-top:5px; padding-right:5px; padding-bottom:5px"><a name="ZH-CN_TOPIC_0000001966059265"></a><a name="ZH-CN_TOPIC_0000001966059265"></a>

<h1 class="topictitle1">创建SFTP用户</h1>
<div><p id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_zh-cn_topic_0000001123352597_p159125100541">系统管理员支持创建具有SFTP存储空间的SFTP用户，通过SFTP用户连接SFTP服务器后进行用户数据的上传和下载。</p>
<div class="section" id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_zh-cn_topic_0223232402_section52135297"><h4 class="sectiontitle">前提条件</h4><p id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_p115222054124215">已经开启SFTP服务。</p>
</div>
<div class="section" id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_section186551153144815"><h4 class="sectiontitle">操作步骤</h4><ol id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_zh-cn_topic_0000001123352597_ol61721291281"><li id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_zh-cn_topic_0000001123352597_li31809451213"><span>在菜单栏上，选择<span class="menucascade" id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_zh-cn_topic_0000001123352597_menucascade1518044511114">“<span class="uicontrol" id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_zh-cn_topic_0000001123352597_uicontrol3181184514118"><span id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_text0778132011103">系统</span></span> &gt; <span class="uicontrol" id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_zh-cn_topic_0000001123352597_uicontrol1718164513119"><span id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_text7957203510917">设置</span></span>”</span>。</span></li><li id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_zh-cn_topic_0000001123352597_li1696145399"><span>在导航栏中，单击<span class="uicontrol" id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_uicontrol153110351319">“<span id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_text1948213394103">SFTP服务</span>”</span>。</span></li><li id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_li8802632469"><span>在<span class="uicontrol" id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_uicontrol1916413215418">“<span id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_text24174611313">授权用户</span>”</span>区域，单击<span class="uicontrol" id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_uicontrol748115312417">“<span id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_text17551118111113">添加</span>”</span>。</span></li><li id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_zh-cn_topic_0000001123352597_li6423103312715"><a name="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_zh-cn_topic_0000001123352597_li6423103312715"></a><a name="zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_zh-cn_topic_0000001123352597_li6423103312715"></a><span>配置SFTP用户参数，相关参数说明如<a href="#ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_zh-cn_topic_0000001123352597_table13374941017">表1</a>所示。</span><p>
<div class="tablenoborder"><a name="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_zh-cn_topic_0000001123352597_table13374941017"></a><a name="zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_zh-cn_topic_0000001123352597_table13374941017"></a><table cellpadding="4" cellspacing="0" summary="" id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_zh-cn_topic_0000001123352597_table13374941017" frame="border" border="1" rules="all"><caption><b>表1 </b>SFTP用户参数说明</caption><colgroup><col style="width:23.96%"><col style="width:76.03999999999999%"></colgroup><thead align="left"><tr id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_zh-cn_topic_0000001123352597_row937139171015"><th align="left" class="cellrowborder" valign="top" width="23.96%" id="mcps1.3.3.2.4.2.1.2.3.1.1"><p id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_zh-cn_topic_0000001123352597_zh-cn_topic_0171822298_p43287665">参数</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="76.03999999999999%" id="mcps1.3.3.2.4.2.1.2.3.1.2"><p id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_zh-cn_topic_0000001123352597_zh-cn_topic_0171822298_p16640014">说明</p>
</th>
</tr>
</thead>
<tbody><tr id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_zh-cn_topic_0000001123352597_row153810991014"><td class="cellrowborder" valign="top" width="23.96%" headers="mcps1.3.3.2.4.2.1.2.3.1.1 "><p id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_zh-cn_topic_0223232411_p6517565"><span id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_text4386152991115">用户名</span></p>
</td>
<td class="cellrowborder" valign="top" width="76.03999999999999%" headers="mcps1.3.3.2.4.2.1.2.3.1.2 "><p id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_zh-cn_topic_0223232411_p58160785">新创建的SFTP用户的名称。</p>
<p id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_zh-cn_topic_0223232411_p13403145">[取值范围]</p>
<ul id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_zh-cn_topic_0223232411_ul53519446"><li id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_zh-cn_topic_0223232411_li11912974">长度为6～32位。</li><li id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_li1695319470583">只能包含数字、字母、“_”，且只能以字母或“_”作为首字符。</li><li id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_zh-cn_topic_0223232411_li40107904">不能是敏感字符（root, bin, daemon, adm, lp, sync, shutdown, halt, mail, operator, games, ftp, nobody, dbus, tss, polkitd, libstoragemgmt, unbound, setroubleshoot, chrony, ntp, sshd, rpc, cloudmonitor, rpcuser, nfsnobody, radvd, uvpkmc, dnsmasq, saslauth, qemu, gluster, dhcpd, hwcdm），且敏感字符不区分大小写。</li></ul>
<p id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_zh-cn_topic_0223232411_p14107846">[示例]</p>
<p id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_zh-cn_topic_0223232411_p59861751">sftpuser</p>
</td>
</tr>
<tr id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_zh-cn_topic_0000001123352597_row13381496108"><td class="cellrowborder" valign="top" width="23.96%" headers="mcps1.3.3.2.4.2.1.2.3.1.1 "><p id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_zh-cn_topic_0223232411_p18455085"><span id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_text846114201115">密码</span></p>
</td>
<td class="cellrowborder" valign="top" width="76.03999999999999%" headers="mcps1.3.3.2.4.2.1.2.3.1.2 "><p id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_zh-cn_topic_0223232411_p18466913">新创建的SFTP用户的密码。</p>
<p id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_zh-cn_topic_0223232411_p19425014">[取值范围]</p>
<ul id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_zh-cn_topic_0223232411_ul40607404"><li id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_zh-cn_topic_0223232411_li29922324">密码长度范围为8~64个字符。</li><li id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_zh-cn_topic_0223232411_li865461">密码必须由特殊字符（~!@%^*_=+{}[]:,.\/?和空格）、大写字母、小写字母和数字中的至少3种组成。</li><li id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_li974935915104">密码不能是回文，如hw123@321wh。</li><li id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_li01371247111513">密码不能包含连续的4个及以上的相同字符。</li><li id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_li16385950191615">密码不能包含3个及以上的连续字符（键盘q-m、字母a-z、数字1-9）及其倒序。</li><li id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_zh-cn_topic_0223232411_li26941704">密码不能包含用户名中连续的3个及以上的字符或用户名的倒写。</li><li id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_li9256111951418">密码不能包含敏感字符（root, bin, daemon, adm, lp, sync, shutdown, halt, mail, operator, games, ftp, nobody, dbus, tss, polkitd, libstoragemgmt, unbound, setroubleshoot, chrony, ntp, sshd, rpc, cloudmonitor, rpcuser, nfsnobody, radvd, uvpkmc,  saslauth, qemu, gluster, dhcpd, hwcdm）。</li><li id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_li13956131271810">以上规则均不区分大小写。</li></ul>
<p id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_zh-cn_topic_0223232411_p65087093">[示例]</p>
<p id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_zh-cn_topic_0223232411_p48912926">abfq@1248</p>
</td>
</tr>
<tr id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_zh-cn_topic_0000001123352597_row17381292106"><td class="cellrowborder" valign="top" width="23.96%" headers="mcps1.3.3.2.4.2.1.2.3.1.1 "><p id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_zh-cn_topic_0223232411_p22716784"><span id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_text18714205116116">确认密码</span></p>
</td>
<td class="cellrowborder" valign="top" width="76.03999999999999%" headers="mcps1.3.3.2.4.2.1.2.3.1.2 "><p id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_zh-cn_topic_0223232411_p28120176">新创建的SFTP用户的确认密码。</p>
<p id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_zh-cn_topic_0223232411_p63141756">[取值范围]</p>
<p id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_zh-cn_topic_0223232411_p31404899"><span class="uicontrol" id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_uicontrol1998712110125">“<span id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_text1164214316124">确认密码</span>”</span>必须与<span class="uicontrol" id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_uicontrol148782301219">“<span id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_text1834449151217">密码</span>”</span>一致。</p>
<p id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_zh-cn_topic_0223232411_p14208637">[示例]</p>
<p id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_p148921364119">abfq@1248</p>
</td>
</tr>
<tr id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_zh-cn_topic_0000001123352597_row8393941011"><td class="cellrowborder" valign="top" width="23.96%" headers="mcps1.3.3.2.4.2.1.2.3.1.1 "><p id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_zh-cn_topic_0000001123352597_p320516317119"><span id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_text1271371110129">配额</span></p>
</td>
<td class="cellrowborder" valign="top" width="76.03999999999999%" headers="mcps1.3.3.2.4.2.1.2.3.1.2 "><p id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_zh-cn_topic_0000001123352597_zh-cn_topic_0171822298_p4100073">新创建的SFTP用户的配额。</p>
<p id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_p11684161853319">支持<span class="uicontrol" id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_uicontrol174764362569">“GB”</span>和<span class="uicontrol" id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_uicontrol19508204175616">“TB”</span>两种单位。</p>
<p id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_p368912186328">取值范围为：大于0GB，小于800TB。取值需为有效整数。</p>
</td>
</tr>
</tbody>
</table>
</div>
</p></li><li id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_zh-cn_topic_0000001123352597_li117683399153"><span>单击<span class="uicontrol" id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_uicontrol161741581645">“<span id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_text182331428139">确定</span>”</span>。</span></li></ol>
</div>
<div class="section" id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_section36681347143711"><h4 class="sectiontitle">后续处理</h4><p id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_p1158182383218"><strong id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_b485132611323">使用SFTP</strong><strong id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_b7186111121214">服务</strong></p>
<p id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_p9316791620">用户在管理界面中创建好SFTP用户后，可以通过如下操作使用SFTP服务：</p>
<p id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_p5884711091">如果本地服务器操作系统为Windows，建议下载SFTP工具进行上传和下载操作。如果本地服务器操作系统为Linux，请参考以下操作步骤：</p>
<ol id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_ol4986539664"><li id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_li3354184518532"><a name="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_li3354184518532"></a><a name="zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_li3354184518532"></a>执行以下命令，以sftpuser用户连接SFTP备份服务器。<pre class="screen" id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_screen129721413151412">sftp -oPort=<em id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_i53471815158">端口号</em> <em id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_i19940113018148">username</em>@<em id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_i13940030151410">IP地址</em></pre>
<p id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_p139371550547">参数说明如</p>

<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_table19645122441616" frame="border" border="1" rules="all"><caption><b>表2 </b>连接SFTP备份服务器参数说明</caption><colgroup><col style="width:27.189999999999998%"><col style="width:72.81%"></colgroup><thead align="left"><tr id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_row8646202412164"><th align="left" class="cellrowborder" valign="top" width="27.189999999999998%" id="mcps1.3.4.5.1.3.2.3.1.1"><p id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_p136465247167">参数</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="72.81%" id="mcps1.3.4.5.1.3.2.3.1.2"><p id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_p14646624111610">说明</p>
</th>
</tr>
</thead>
<tbody><tr id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_row5646152413166"><td class="cellrowborder" valign="top" width="27.189999999999998%" headers="mcps1.3.4.5.1.3.2.3.1.1 "><p id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_p18646152415168">username</p>
</td>
<td class="cellrowborder" valign="top" width="72.81%" headers="mcps1.3.4.5.1.3.2.3.1.2 "><p id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_p11646024131618"><a href="#ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_zh-cn_topic_0000001123352597_li6423103312715">4</a>中添加的SFTP用户，此处以sftpuser为例。</p>
</td>
</tr>
<tr id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_row206461247169"><td class="cellrowborder" valign="top" width="27.189999999999998%" headers="mcps1.3.4.5.1.3.2.3.1.1 "><p id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_p136461724121612">IP地址</p>
</td>
<td class="cellrowborder" valign="top" width="72.81%" headers="mcps1.3.4.5.1.3.2.3.1.2 "><p id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_p11646524141617">SFTP服务器的IP地址。即<a href="zh-cn_topic_0000001938980050.html#ZH-CN_TOPIC_0000001938980050">查看SFTP服务</a>中<a href="zh-cn_topic_0000001938980050.html#ZH-CN_TOPIC_0000001938980050__zh-cn_topic_0000001955402757_zh-cn_topic_0000001839224857_li1225141815444">3</a>查看到的IP地址。</p>
</td>
</tr>
<tr id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_row1864642415166"><td class="cellrowborder" valign="top" width="27.189999999999998%" headers="mcps1.3.4.5.1.3.2.3.1.1 "><p id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_p18646124131612">端口号</p>
</td>
<td class="cellrowborder" valign="top" width="72.81%" headers="mcps1.3.4.5.1.3.2.3.1.2 "><p id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_p464611241164">默认为“22”。</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="note" id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_note613292113402"><img src="public_sys-resources/note_3.0-zh-cn.png"><span class="notetitle"> </span><div class="notebody"><p id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_zh-cn_topic_0000001123352597_p10738881161">使用SFTP用户连接SFTP备份服务器时，如果出现以下异常：WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! ，请进入本地服务器的“/root/.ssh/”目录，删除known_hosts文件中SFTP服务器IP地址所在行的内容后重试。</p>
</div></div>
</li><li id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_li832614421873">根据系统提示，输入sftpuser用户登录SFTP服务器的密码，进入SFTP命令行。<div class="note" id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_note166010101164"><img src="public_sys-resources/note_3.0-zh-cn.png"><span class="notetitle"> </span><div class="notebody"><p id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_p14601210101611">登录SFTP服务器后，推荐您参考<a href="#ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_section2044233882315">在SFTP服务端添加SFTP客户端用户的公钥</a>，在SFTP服务端添加一个或多个客户端用户的公钥。添加完成后，您后续可以在SFTP客户端对应用户下，使用公钥免密登录服务端。</p>
</div></div>
</li><li id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_li16417193210263">执行<strong id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_b1686585111261">cd</strong> <em id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_i594116127281">用户名</em>命令，进入SFTP备份服务器目录“/sftpuser”；执行<strong id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_b6184822102720">l</strong><strong id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_b185977156279">cd</strong><strong id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_b23508364280"> /opt</strong>命令，进入本地服务器目录“/opt”。</li><li id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_li3986153910618">查看SFTP备份服务器目录和本地服务器目录。<p id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_p1831669663"><a name="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_li3986153910618"></a><a name="zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_li3986153910618"></a>执行<strong id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_b1031639162">pwd</strong>命令，查看SFTP备份服务器当前的目录，执行<strong id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_b18236415134313">lpwd</strong>命令，查看本地服务器当前的目录。如：SFTP备份服务器回显的目录为“/sftpuser”，本地服务器回显的目录为“/opt”。</p>
<ul id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_ul176441153121720"><li id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_li20538141261815">SFTP上传文件至SFTP备份服务器。<p id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_p202762217910"><a name="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_li20538141261815"></a><a name="zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_li20538141261815"></a>执行<strong id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_b03161191569">put /opt/file1.conf /sftpuser</strong>命令，将本地服务器的“/opt”目录下的file1.conf文件上传至SFTP备份服务器的“/sftpuser”目录下。</p>
</li><li id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_li129701921131816">SFTP上传目录至SFTP备份服务器。<ol type="a" id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_ol5565614144416"><li id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_li145651314104418">执行<strong id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_b62651042243">mkdir </strong><em id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_i6725104218417">file1</em>命令，在“/sftpuser”目录下新建“file1”目录。<p id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_p10561641864">其中，file1目录的名称需要和本地服务器上传的目录名称一致。</p>
</li><li id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_li1581595354411">执行<strong id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_b9428124610419">put -r /opt/</strong><em id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_i1287710461415">file1</em><strong id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_b134283461446"> /sftpuser</strong>命令，将本地服务器的“/opt/file1”目录上传至SFTP备份服务器的“/sftpuser”目录下。</li></ol>
</li><li id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_li176447532177">SFTP下载文件至本地服务器。<p id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_p44601261085"><a name="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_li176447532177"></a><a name="zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_li176447532177"></a>执行<strong id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_b1431616915612">get /sftpuser/file.conf /opt</strong>命令，将SFTP备份服务器的“/sftpuser”目录下的file.conf文件下载至本地服务器的“/opt”目录下。</p>
</li><li id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_li165559441812">SFTP下载目录至本地服务器。<ol type="a" id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_ol1986715275012"><li id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_li169631813261">执行<strong id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_b836413540415">mkdir </strong><em id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_i1386818541345">file</em>命令，在“/opt”目录下新建“file”目录。<p id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_p1832318141361">其中，file目录的名称需要和下载的SFTP备份服务器目录名称一致。</p>
</li><li id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_li19521112325019">执行<strong id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_b25151231879">get -r /sftpuser/</strong><em id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_i792642719">file</em><strong id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_b1051513317716"> /opt</strong>命令，将SFTP备份服务器的“/sftpuser/file”目录下载至本地服务器的“/opt”目录下。</li></ol>
</li></ul>
</li></ol>
</div>
<div class="section" id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_section2044233882315"><a name="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_section2044233882315"></a><a name="zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_section2044233882315"></a><h4 class="sectiontitle">在SFTP服务端添加SFTP客户端用户的公钥</h4><p id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_p174313612418">如果有多个SFTP客户端需要以某个SFTP用户访问服务端，强烈建议参考本节操作，将多个SFTP客户端用户的公钥添加到服务端。首次添加公钥与非首次添加公钥的操作稍有不同，此处将分别介绍。</p>
<p id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_p18830561315">此处以在客户端root用户下，以服务端sftpuser用户登录服务端为例。</p>
<ol id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_ol199542309479"><li id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_li116231118654"><span>执行以下命令，进入sftpuser用户目录。</span><p><pre class="screen" id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_screen1885964753815">cd /sftpuser</pre>
</p></li><li id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_li186061346102016"><span>执行以下命令，查看sftpuser用户目录下是否已添加过公钥。</span><p><pre class="screen" id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_screen1397115212214">ls</pre>
<div class="p" id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_p8804185172110">如果回显<strong id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_b16523112155819">不包含</strong>如下内容，说明sftpuser用户目录下，当前未添加公钥，请执行<a href="#ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_li177571338172219">首次添加公钥</a>。否则，请执行<a href="#ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_li1414218493223">非首次添加公钥</a>。<pre class="screen" id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_screen780495142118">authorized_keys</pre>
</div>
<ul id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_ul675783817228"><li id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_li177571338172219"><a name="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_li177571338172219"></a><a name="zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_li177571338172219"></a><strong id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_b932413291412">首次添加公钥</strong><ol type="a" id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_ol035269111716"><li id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_li6352159171719">执行以下命令生成公钥。<pre class="screen" id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_screen6664413147">ssh-keygen -t rsa</pre>
</li><li id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_li235229121713">在SFTP命令行执行以下命令，在sftpuser用户目录下，添加客户端root用户的公钥。<pre class="screen" id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_screen1180865710477">put /root/.ssh/id_rsa.pub /sftpuser/authorized_keys</pre>
<div class="note" id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_note12191174921016"><img src="public_sys-resources/note_3.0-zh-cn.png"><span class="notetitle"> </span><div class="notebody"><ol id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_ol113521292173"><li id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_li2352199181717">添加完成后，在该客户端root用户下，可以以sftpuser用户免密登录SFTP服务端。在该客户端的其他用户下，仍然需要使用密码登录。</li></ol>
</div></div>
</li></ol>
</li><li id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_li1414218493223"><a name="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_li1414218493223"></a><a name="zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_li1414218493223"></a><strong id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_b1412222192314">非首次添加公钥</strong><ol type="a" id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_ol189204820259"><li id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_li1692011810253"><a name="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_li1692011810253"></a><a name="zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_li1692011810253"></a>执行以下命令，将sftpuser用户目录下已有的公钥暂时存放在本地服务器的<span class="uicontrol" id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_uicontrol1265124212314">“/root/authorized_keys”</span>文件。<pre class="screen" id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_screen36504215236">get /sftpuser/authorized_keys /root/authorized_keys</pre>
</li><li id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_li10572121292511">执行以下命令，退出SFTP命令行。<pre class="screen" id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_screen3677191853118">exit</pre>
</li><li id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_li12507144182518">登录非root用户执行以下命令生成公钥，生成后切换为root用户。<pre class="screen" id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_screen39352892613">ssh-keygen -t rsa</pre>
</li><li id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_li1152402412311"><a name="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_li1152402412311"></a><a name="zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_li1152402412311"></a>执行以下命令，将本客户端当前非root用户的公钥与sftpuser用户目录下已有的公钥进行拼接。拼接后的公钥存放在本地服务器的<span class="uicontrol" id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_uicontrol15663831103419">“/root/authorized_keys”</span>文件。<pre class="screen" id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_screen1647317516327">cat /home/<em id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_i1043382252720">xxx</em>/.ssh/id_rsa.pub &gt;&gt; /root/authorized_keys</pre>
<div class="note" id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_note1789032543016"><img src="public_sys-resources/note_3.0-zh-cn.png"><span class="notetitle"> </span><div class="notebody"><p id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_p168906259308">xxx表示非root用户名。</p>
</div></div>
</li><li id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_li1474956143318">执行<a href="#ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_li1692011810253">2.a</a>进入SFTP命令行。</li><li id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_li1764077123619">执行以下命令，添加<a href="#ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_li1152402412311">2.d</a>中拼接好的公钥。<pre class="screen" id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_screen1931125115382">put /root/authorized_keys /sftpuser/authorized_keys</pre>
</li></ol>
</li></ul>
</p></li><li id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_li159531914135518"><span>验证公钥是否添加成功。</span><p><p id="ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_p4197733165618">重新执行<a href="#ZH-CN_TOPIC_0000001966059265__zh-cn_topic_0000001928243232_zh-cn_topic_0000001792505514_li3354184518532">1</a>，能够直接进入SFTP命令行，表明公钥已添加成功。</p>
</p></li></ol>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>父主题：</strong> <a href="zh-cn_topic_0000001965939061.html">管理SFTP服务（适用于1.6.0及后续版本）</a></div>
</div>
</div>

<div class="hrcopyright"><hr size="2"></div><div class="hwcopyright">版权所有 &copy; 华为技术有限公司</div></body>
</html>